import os


def remove_part_from_filenames(dir_path, part_to_remove):
    """
    批量去除文件名中的某一部分
    :param dir_path: 目录路径
    :param part_to_remove: 要删除的部分
    :return: 操作结果信息
    """
    if not os.path.isdir(dir_path):
        raise ValueError(f"目录不存在：{dir_path}")

    result = []
    for filename in os.listdir(dir_path):
        if part_to_remove in filename:
            new_filename = filename.replace(part_to_remove, "")
            old_file_path = os.path.join(dir_path, filename)
            new_file_path = os.path.join(dir_path, new_filename)
            os.rename(old_file_path, new_file_path)
            result.append(f"{filename} -> {new_filename}")

    return "\n".join(result) if result else "没有文件需要修改。"
